package com.methods;

/**
 * 杨梅类
 * 2017/8/16
 * @author Erik
 * @version 0.1
 * @since JDK1.8
 * @see com.methods.Fruits
 */
public  final class Waxberry extends Fruits{
    private String color;

    public Waxberry(){}

    /**
     * 三参数构造函数
     * 初始化所有信息
     * @param shape 形状
     * @param taste 口味
     * @param color 颜色
     */
    public Waxberry(String shape,String taste,String color){
        super.setShape(shape);
        super.setTases(taste);
        this.setColor(color);
    }

    //setter
    public void setColor(String color)      {    this.color=color;  }
    //getter
    public String getColor()    {   return this.color;  }

    public void eat(){
        //TODO 描述口感
        System.out.println("杨梅"+this.getTases());
    }

    public final void face(){
        //TODO 描述外形
        System.out.println("杨梅: "+this.getColor()+"  "+this.getShape()+","+this.getTases());
    }

    public String toString(){
        //TODO 重写方法，描述整体信息
        String info =   "果实为"+this.getShape()+"、"+this.getColor()+"，"+this.getTases();
        return info;
    }
}
